<script type="text/javascript" >
    jQuery(document).ready(function() {
    stFacebookToolbox.load_tooltip();
    stFacebookToolbox.on_submitform('#settingForm');
    stFacebookToolbox.sortColumn();
    });
</script>

<div class="w100p bgl">
    <div class="w100p bgr p5b">
                <ul class="menu_right">
                      <li class="current">
                          <a href="javascript:void(0);" onclick="stFacebookToolboxcustom.loadPage('page_analytics');" id="page_overview">Page Overview</a>
                    </li>
                    <li>
                          <a href="javascript:void(0);" onclick="stFacebookToolboxcustom.loadPage('fan_count');" id="fan_count">Fan count</a>
                    </li>
                    <li>
                          <a href="javascript:void(0);" onclick="stFacebookToolboxcustom.loadPage('user_activity');" id="user_activity">User activity</a>
                    </li>
                    <li>
                          <a href="javascript:void(0);" onclick="stFacebookToolboxcustom.loadPage('viral_spread');" id="viral_spread">Viral Spread</a>
                    </li>
                    <li>
                          <a href="javascript:void(0);" onclick="stFacebookToolboxcustom.loadPage('fan_list');" id="fan_list">Fan list</a>
                    </li>
                </ul>
                <p></p>
<h2 class="red_color" style="padding-left:15px;">Monitored Facebook pages
            </h2>
<table class="widefat" cellspacing="0">
                <thead>
                    <tr>
                        <?php print_column_headers('stFacebookToolbox_stFacebookToolbox'); ?>
                    </tr>
                </thead>

                <tbody>
                <?php
                if (count($results) > 0) {
                    $tr_class = "";
                    $upload_data = wp_upload_dir();
                    foreach ($results as $result) {
                        $total = (intval($result->like_count)+intval($result->share_count)+intval($result->comment_count)+intval($result->click_count));
                        if( empty($tr_class) || $tr_class == "class='bg_gray2'"){
                            $tr_class = "class='bg_gray1'";
                        }else{
                            $tr_class = "class='bg_gray2'";
                        }
                        echo "<tr id='$result->pageid' $tr_class >"
                        . "<td><img src='" . $result->pagepictureurl. "' style='width: 75px;cursor:pointer;' onclick='window.open(\"http://www.facebook.com/profile.php?id=".$result->pageid."\");' /></td>"
                        . "<td>" . $result->pagename
                        . "<td>".$model->get_fan($result->pageid)."</td>"
                        . "</tr>"
                        ;
                    }
                }
                ?>
                </tbody>
            </table>
            <div class="page_d">
                <?php echo $pagination?>
                <div class="cl"></div>
            </div>
    </div>
</div>
